/**
 * 首页展示
 */
import * as React from 'react';
import {View} from 'react-native';
import {WebView} from 'react-native-webview';
import {BProps, HeaderView, BaseComponent, Host} from '../../index';
const _ = require('lodash');
//下面是amis的控件已经使用

export default class EntityDetailPageComponent extends BaseComponent<BProps> {
  constructor(props: BProps) {
    super(props);
    // this.refs.webview.postMessage(this.props);
  }

  render() {
    let uri = Host.AMIS_HOST + Host.INDEX_PAGE;
    return (
      <View style={{flex: 1}}>
        <HeaderView
          componentId={this.props.componentId}
          title={this.props.title ? this.props.title : 'amis'}
          navigator={this.props.navigator}
        />
        <WebView
          ref={'webview'}
          source={{uri: uri}}
          onMessage={event => {
            console.log(event.nativeEvent);
          }}
        />
      </View>
    );
  }
}
